<template>
	<view class="detail-block">
    <template v-if="type=='study'">
      <view class="block-row">
        <view>积分总分</view>
        <view><score-tag :score="info.StaffScore"></score-tag></view>
      </view>
      <view class="block-row">
        <view>学习试卷</view>
        <view>{{info.TypeStr}}</view>
      </view>
      <view class="block-row">
        <view>积分变化</view>
        <view>-{{info.Score}} 分</view>
      </view>
      <view class="block-row">
        <view>学习时间</view>
        <view>{{info.ETime.replace('T', ' ')}}</view>
      </view>
      
    </template>
    
		<template v-if="type=='score'">
		  <view class="block-row">
		    <view>红绿码</view>
		    <view>
          <score-tag :score="info.StaffScore"></score-tag>
         </view>
		  </view>
		  <view class="block-row">
		    <view>变化原因</view>
		    <view>{{info.TypeStr}}</view>
		  </view>
		  <view class="block-row">
		    <view>积分变化</view>
		    <view>{{info.Type == 0 ? '+ ':'- '}}{{info.Score}} 分</view>
		  </view>
		  <view class="block-row">
		    <view>时间</view>
		    <view>{{info.AddTime.replace('T',' ')}}</view>
		  </view>
      <view v-if="info.ImgName" class="block-row" @tap="goDetail()">
        <view>凭证</view>
        <view class="__blue">详情</view>
      </view>
		</template>
	</view>
</template>

<script>
  import ScoreTag from '@/components/score-tag/score-tag.vue'
	export default {
		name: 'DetailBlock',
    components: {
      ScoreTag
    },
		props:{
      type:{
        type:String,
        default:''
      },
      info:{
        type:Object,
        default:()=>({})
      }
		},
    methods:{
      goDetail(){
        const data = JSON.stringify(this.info)
        uni.navigateTo({
          url:`../../../../UserListIllegalDetail/index?pageType=illegal&info=${data}`
        })
        console.log(1)
      }
    }
	}
</script>

<style lang="scss">
.detail-block{
  padding:32rpx;
  margin-bottom: 32rpx;
  background-color: #fff;
  .block-row{
    margin-bottom: 32rpx;
    display: flex;
    justify-content: space-between;
    font-size: 30rpx;
    color:#333;
    background: #FFFFFF;
    border-radius: 8px;
    &:last-child{
      margin-bottom: 0;
    }
    .__blue{
      color:blue;
    }
  }
}
</style>
